﻿using System;

namespace Borg
{
    [Serializable]
    public class LoggerConfig : TypeConfig
    {
        private string _path;

        public string Path
        {
            get { return _path; }
            set { _path = value; }
        }

        public LoggerConfig()
        { }

        public LoggerConfig(string type, string path)
            : base(type)
        {
            _path = path;
        }

        public override bool Equals(object obj)
        {
            if (this == obj)
                return true;

            if (!(obj is LoggerConfig))
                return false;

            var loggerConfig = (LoggerConfig)obj;

            return
                Type == loggerConfig.Type &&
                Path == loggerConfig.Path;
        }

        public override int GetHashCode()
        {
            return
                (Type ?? string.Empty).GetHashCode() ^
                (Path ?? string.Empty).GetHashCode();
        }
    }
}
